package com.whfc.fmam.entity.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author sun_guodong
 * @description
 * @date 2019-12-20
 */
@Data
public class FmamSupplierAnaMatDTO implements Serializable {
    /**
     * 材料id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long matId;
    /**
     * 材料名称
     */
    private String matName;
    /**
     * 规格
     */
    private String spec;
    /**
     * 型号
     */
    private String model;
    /**
     * 供应商id
     */
    private Integer sendSupplierId;
    /**
     * 供应商名称
     */
    private String sendSupplierName;
    /**
     * 单位
     */
    private String unitName;
    /**
     * 运单数量
     */
    private Double deliveryAmount;
    /**
     * 实际数量
     */
    private Double actualAmount;
    /**
     * 运单重量
     */
    private Double deliveryWeight;
    /**
     * 实际重量
     */
    private Double actualWeight;
    /**
     * 重量偏差
     */
    private Double weightDiff;
    /**
     * 数量偏差
     */
    private Double amountDiff;
    /**
     * 重量偏差率
     */
    private Double weightDiffPercent;
    /**
     * 数量偏差率
     */
    private Double amountDiffPercent;

    private List<FmamSendSupplierDTO> sendSupplierList;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FmamSupplierAnaMatDTO that = (FmamSupplierAnaMatDTO) o;
        return matId.equals(that.matId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(matId);
    }
}
